package com.tnr.scgcxx.controller.safty;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.tnr.scgcxx.dto.MenuDto;
import com.tnr.scgcxx.service.safty.HomeService;

@Controller
@RequestMapping("/safty")//统一配置父路径
public class SaftyView {
	
	@Autowired
	private HomeService homeService;
	
	
	/**
	 * 登录
	 * @return
	 */
	@RequestMapping("/login_to")//配置子路径
	public String loginTo(){
		
		return "safty/login";
	}
	
	/**
	 * 主界面
	 * @return
	 */
	@RequestMapping("/home_to")//配置子路径
	public String homeTo(Model model){
		List<MenuDto> list = homeService.getMenus();
		model.addAttribute("menuList", list);
		return "safty/home";
	}
}
